package org.song.util;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Component;

/**
 * springSecurity默认加密工具类
 */
@Component( value = "bCryptPasswordEncoderUtil")
public class BCryptPasswordEncoderUtil extends BCryptPasswordEncoder {

    /**
     * 对密码进行加密
     * @param rawPassword
     * @return
     */
    @Override
    public String encode(CharSequence rawPassword) {
        return super.encode(rawPassword);
    }

    /**
     * 对密码进行比对
     * @param rawPassword
     * @param encodedPassword
     * @return
     */
    @Override
    public boolean matches(CharSequence rawPassword, String encodedPassword) {
        return super.matches(rawPassword,encodedPassword);
    }

}
